import React from 'react'
import {Routes, Route, NavLink} from 'react-router-dom'

import About from './pages/About'
import Home from './pages/Home'

export default function App() {
  return (
    <div>
      {/* 路由连接, 最终转换为a标签, to转为href */}
      <NavLink to='/about'>About</NavLink> <br />
      <NavLink to='/home'>Home</NavLink>
      <hr />
      {/* 注册路由: 路由在页面的哪里注册, 就在哪显示 */}
      <Routes>
        <Route path='/about' element={<About/>}></Route>
        <Route path='/home' element={<Home/>}></Route>
      </Routes>
    </div>
  )
}
